/**
 * 
 */
package com.gr.staffpm.pages.management.resources.team;

import org.apache.wicket.IRequestTarget;
import org.apache.wicket.PageParameters;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.markup.html.WebPage;
import org.wicketstuff.annotation.mount.MountPath;
import org.wicketstuff.annotation.strategy.MountHybrid;


/**
 * @author Graham Rhodes 4 Apr 2011 22:11:01
 */
@MountHybrid
@MountPath(path = "secure/TeamResourcesJson")
public class TeamResourcesJson extends WebPage {

    private static final String data = "{ "
            + "staff : [{"
            + "YourIdField : 'a',"
            + "Name : 'Rob',"
            + "Type : 'Sales',"
            + "ImgUrl : 'images/homer.png',"
            + "Color: 'Turquoise'"
            + "},"
            + "{"
            + " YourIdField : 'b',"
            + "Name : 'Mike',"
            + "Type : 'Sales',"
            + "ImgUrl : 'images/homer.png',"
            + "Color: 'Coral'"
            + "},"
            + "{"
            + "YourIdField : 'c',"
            + "Name : 'Kate',"
            + "Type : 'Product manager',"
            + "ImgUrl : 'images/lisa.jpg',"
            + "Color: 'CornflowerBlue'"
            + "},"
            + "{"
            + "YourIdField : 'd',"
            + "Name : 'Lisa',"
            + "Type : 'Developer',"
            + "ImgUrl : 'images/lisa.jpg',"
            + "Color: 'Coral'"
            + "},"
            + "{"
            + "YourIdField : 'e',"
            + "Name : 'Dave',"
            + "Type : 'Developer',"
            + "ImgUrl : 'images/dave.jpg',"
            + "Color: 'Purple'"
            + "},"
            + "{"
            + "YourIdField : 'f',"
            + "Name : 'Arnold',"
            + "Type : 'Developer',"
            + "ImgUrl : 'images/arnold.jpg',"
            + "Color: 'Gray'"
            + "},"
            + "{"
            + "YourIdField : 'g',"
            + "Name : 'Lee',"
            + "Type : 'Marketing',"
            + "ImgUrl : 'images/lee.jpg',"
            + "Color: 'Orange'"
            + "},"
            + "{"
            + "YourIdField : 'h',"
            + "Name : 'Jong',"
            + "Type : 'Marketing',"
            + "ImgUrl : 'images/homer.png',"
            + "Color: 'MediumSlateBlue'"
            + "}],tasks : [{"
            + "ResourceId : 'a',"
            + "Title : 'Some task', "
            + "StartDate : '2011-02-07 11:00',"
            + "EndDate : '2011-02-07 13:00',"
            + "Location : 'Some office'"
            + "},"
            + "{"
            + "ResourceId : 'b',"
            + "Title : 'Some other task', "
            + "StartDate : '2011-02-07 13:00',"
            + "EndDate :  '2011-02-07 16:00',"
            + "Location : 'Home office'"
            + "},"
            + "{"
            + "ResourceId : 'c',"
            + "Title : 'A basic task', "
            + "StartDate : '2011-02-07 9:00',"
            + "EndDate :  '2011-02-07 13:00',"
            + "Location : 'Customer office'"
            + "},"
            + "{"
            + "ResourceId : 'd',"
            + "Title : 'Some task', "
            + "StartDate : '2011-02-07 9:00',"
            + "EndDate : '2011-02-07 12:00',"
            + "Location : 'Some office'"
            + "},"
            + "{"
            + "ResourceId : 'e',"
            + "Title : 'Some other task', "
            + "StartDate : '2011-02-07 13:00',"
            + "EndDate :  '2011-02-07 16:00',"
            + "Location : 'Home office'"
            + "},"
            + "{"
            + "ResourceId : 'f',"
            + "Title : 'A basic task', "
            + "StartDate : '2011-02-07 9:00',"
            + "EndDate :  '2011-02-07 13:00',"
            + "Location : 'Customer office'"
            + "},"
            + "{"
            + "ResourceId : 'g',"
            + "Title : 'Some other task', "
            + "StartDate : '2011-02-07 17:00',"
            + "EndDate :  '2011-02-07 18:00',"
            + "Location : 'Home office'"
            + "},"
            + "{"
            + "ResourceId : 'h',"
            + "Title : 'A basic task', "
            + "StartDate : '2011-02-07 15:00',"
            + "EndDate :  '2011-02-07 17:00',"
            + "Location : 'Customer office'"
            + "}]"
            + "}";


    public TeamResourcesJson(PageParameters pageParameters) {
        getRequestCycle().setRequestTarget(new IRequestTarget() {

            @Override
            public void detach(RequestCycle requestCycle) {
                // Nothing to do here.
            }

            @Override
            public void respond(RequestCycle requestCycle) {
                // Add JSON-encoded string to the response.
                requestCycle.getResponse().write(data);
            }

        });
    }
}
